package com.medusa.aps.business.modules.plan.controller;


import com.medusa.aps.business.common.model.resp.Result;
import com.medusa.aps.business.model.pagination.Page;
import com.medusa.aps.business.modules.plan.model.input.SchedulingTaskViewPageParam;
import com.medusa.aps.business.modules.plan.mp.entity.SchedulingTaskView;
import com.medusa.aps.business.modules.plan.mp.service.SchedulingTaskViewService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 排产任务视图控制层
 *
 * @author yuxh
 * @since 2023-08-14 17:37:49
 */
@Slf4j
@RestController
@RequestMapping("/scheduling/task/view")
@Tag(name = "排产任务视图控制层", description = "排产任务视图控制层")
public class SchedulingTaskViewController {
    /**
     * 服务对象
     */
    @Resource
    private SchedulingTaskViewService schedulingTaskViewService;

    /**
     * 分页查询所有数据
     *
     * @param schedulingTaskView 查询实体
     * @return 所有数据
     */
    @GetMapping("/select/page")
    @Operation(description = "分页查询所有数据", summary = "分页查询所有数据")
    public Result<Page<SchedulingTaskView>> selectPage(SchedulingTaskViewPageParam schedulingTaskView) {
        return Result.ok(schedulingTaskViewService.selectPage(new Page<>(schedulingTaskView.getCurrent(), schedulingTaskView.getSize()), schedulingTaskView));
    }
}

